<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:a="https://ajax4jsf.dev.java.net/ajax"
	xmlns:rich="http://richfaces.ajax4jsf.org/rich"
	xmlns:ctg="http://www.crotouristguide.com/taglib"
	template="/templates/layout/columns_1.xhtml">

	<ui:define name="column1">
		<rich:panel styleClass="blue-panel">
			<h:form id="accSearchForm">
				<a:region renderRegionOnly="true">
					<ctg:status />
					<s:div styleClass="title"><h1><h:outputText
						value="#{messages['title.accomodation.search']}" /> </h1>
						<h:outputText value="#{messages['subtitle.accomodation.search']}" />
					</s:div>
					<s:div id="accSearch">
						<s:decorate id="tipObjektaDecoration"
							template="/templates/display.xhtml">
							<ui:define name="label">#{messages['label.object.type']}</ui:define>
							<h:selectOneMenu id="tipObjekta" styleClass="field"
								binding="#{objektSearch.selectTipObjekta}"
								value="#{searchParameters.tipObjekta}">
								<s:selectItems var="to" value="#{tipoviObjekata}"
									label="#{messages[stringUtil.merge(to.idTipaObjekta)]}"></s:selectItems>
								<a:support event="onchange" bypassUpdates="true"></a:support>
								<s:convertEntity></s:convertEntity>
							</h:selectOneMenu>
						</s:decorate>
						<br />
						<h3><h:outputText
							value="#{messages['label.search.location']}" /></h3>
						<a:region renderRegionOnly="true">
							<h:panelGrid columns="3" cellpadding="0" cellspacing="0">
								<s:decorate id="zupanijaDecoration"
									template="/templates/display.xhtml">
									<ui:define name="label">#{messages['label.zupanija']}:</ui:define>
									<h:selectOneMenu id="zupanija" styleClass="field"
										binding="#{objektSearch.selectZupanija}"
										valueChangeListener="#{objektSearch.onZupanijaSelected}"
										value="#{searchParameters.zupanija}">
										<s:selectItems id="zupanije" value="#{objektSearch.zupanije}"
											var="z" label="#{z.naziv}"
											noSelectionLabel="#{messages['label.choose']}" />
										<a:support event="onchange"
											reRender="otokDecoration,mjestoDecoration"
											bypassUpdates="true" />
										<s:convertEntity></s:convertEntity>
									</h:selectOneMenu>
								</s:decorate>

								<s:decorate id="otokDecoration"
									template="/templates/display.xhtml">
									<ui:define name="label">#{messages['label.otok']}:</ui:define>
									<h:selectOneMenu id="otok" styleClass="field"
										binding="#{objektSearch.selectOtok}"
										valueChangeListener="#{objektSearch.onOtokSelected}"
										value="#{searchParameters.otok}">
										<s:selectItems id="otoci" value="#{objektSearch.otoci}"
											var="z" label="#{z.naziv}"
											noSelectionLabel="#{messages['label.choose']}" />
										<a:support event="onchange"
											reRender="otokDecoration,mjestoDecoration"
											bypassUpdates="true" />
										<s:convertEntity></s:convertEntity>
									</h:selectOneMenu>
								</s:decorate>

								<s:decorate id="mjestoDecoration"
									template="/templates/display.xhtml">
									<ui:define name="label">#{messages['label.mjesto']}:</ui:define>
									<h:selectOneMenu id="mjesto" styleClass="field mjesto"
										value="#{searchParameters.mjesto}"
										binding="#{objektSearch.selectMjesto}">
										<s:selectItems id="mjesta" value="#{objektSearch.mjesta}"
											var="z" label="#{z.naziv}"
											noSelectionLabel="#{messages['label.choose']}" />
										<s:convertEntity></s:convertEntity>
									</h:selectOneMenu>
								</s:decorate>
							</h:panelGrid>
						</a:region>
						<br />
						<h3><h:outputText
							value="#{messages['label.search.objekt.details']}"></h:outputText>
						</h3>
						<table cellpadding="0" cellspacing="0">
							<tr>
								<td colspan="4"><s:decorate id="nazivObjektaLikeDecoration"
									template="/templates/edit.xhtml">
									<ui:define name="label">
										<h:outputText value="#{messages['label.name_contains']}:"></h:outputText>
									</ui:define>
									<h:inputText id="objektNazivLike" styleClass="field"
										value="#{searchParameters.nazivObjekta}">
									</h:inputText>
								</s:decorate></td>
							</tr>
							<tr>
								<td><s:decorate template="/templates/edit.xhtml">
									<ui:define name="label">
										<h:outputText value="#{messages['label.max.price']}:" />
									</ui:define>
									<h:inputText styleClass="field"
										value="#{searchParameters.maxCijena}" id="maxCijena">
									</h:inputText>
								</s:decorate></td>
								<td><s:decorate id="brojZvjezdicaDecoration"
									template="/templates/display.xhtml">
									<ui:define name="label">
										<h:outputText value="#{messages['label.stars.number']}:"></h:outputText>
									</ui:define>
									<h:selectOneMenu id="stars" styleClass="field"
										value="#{searchParameters.brojZvjezdica}">
										<f:selectItem itemLabel="#{messages['label.choose']}"
											itemValue="" />
										<f:selectItem itemLabel="1" itemValue="1" />
										<f:selectItem itemLabel="2" itemValue="2" />
										<f:selectItem itemLabel="3" itemValue="3" />
										<f:selectItem itemLabel="4" itemValue="4" />
										<f:selectItem itemLabel="5" itemValue="5" />
									</h:selectOneMenu>
								</s:decorate></td>
								<td><s:decorate id="ratingDecoration"
									template="/templates/display.xhtml">
									<ui:define name="label">
										<h:outputText value="#{messages['label.user.ratings']}:"></h:outputText>
									</ui:define>
									<h:selectOneMenu id="rating" styleClass="field"
										value="#{searchParameters.ocjena}">
										<f:selectItem itemLabel="#{messages['label.choose']}"
											itemValue="" />
										<f:selectItem itemLabel="1 #{messages['label.or.more']}"
											itemValue="1" />
										<f:selectItem itemLabel="2 #{messages['label.or.more']}"
											itemValue="2" />
										<f:selectItem itemLabel="3 #{messages['label.or.more']}"
											itemValue="3" />
										<f:selectItem itemLabel="4 #{messages['label.or.more']}"
											itemValue="4" />
										<f:selectItem itemLabel="5 #{messages['label.or.more']}"
											itemValue="5" />
										<f:selectItem itemLabel="6 #{messages['label.or.more']}"
											itemValue="6" />
										<f:selectItem itemLabel="7 #{messages['label.or.more']}"
											itemValue="7" />
										<f:selectItem itemLabel="8 #{messages['label.or.more']}"
											itemValue="8" />
										<f:selectItem itemLabel="9 #{messages['label.or.more']}"
											itemValue="9" />
										<f:selectItem itemLabel="10" itemValue="10" />
									</h:selectOneMenu>
								</s:decorate></td>
								<td><s:decorate template="/templates/edit.xhtml">
									<ui:define name="label">
										<h:outputText value="#{messages['label.number.guests']}:" style="white-space:nowrap"/>
									</ui:define>
									<h:selectOneMenu styleClass="field"
										value="#{searchParameters.osobe}">
										<f:selectItem itemLabel="#{messages['label.choose']}"
											itemValue="" />
										<f:selectItem itemLabel="1" itemValue="1" />
										<f:selectItem itemLabel="2" itemValue="2" />
										<f:selectItem itemLabel="3" itemValue="3" />
										<f:selectItem itemLabel="4" itemValue="4" />
										<f:selectItem itemLabel="5" itemValue="5" />
										<f:selectItem itemLabel="6" itemValue="6" />
										<f:selectItem itemLabel="7" itemValue="7" />
										<f:selectItem itemLabel="8" itemValue="8" />
										<f:selectItem itemLabel="9" itemValue="9" />
										<f:selectItem itemLabel="10" itemValue="10" />
										<f:selectItem itemLabel="15" itemValue="15" />
										<f:selectItem itemLabel="20" itemValue="20" />
										<f:selectItem itemLabel="50" itemValue="50" />
									</h:selectOneMenu>
								</s:decorate></td>
								<td></td>
								<td></td>
							</tr>
						</table>
						<br />
						<h3><h:outputText value="#{messages['label.osobine']}"></h:outputText>
						</h3>
						<a:outputPanel ajaxRendered="true" id="osobine">
							<h:panelGrid border="0" columns="8" cellpadding="0"
								cellspacing="0"
								rendered='#{objektSearch.selectTipObjekta.value == null or objektSearch.selectTipObjekta.value == "1"}'>
								<s:label value="#{messages['label.osobina.132']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.ljubimci}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.79']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.nudizam}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.29']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.sanCvorovi}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.34']}" />
								<h:selectBooleanCheckbox
									value="#{searchParameters.prilInvalidima}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.42']}" />
								<h:selectBooleanCheckbox
									value="#{searchParameters.praonicaRublja}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.43']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.igrDjeca}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.44']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.privez}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.47']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.restoran}"></h:selectBooleanCheckbox>
							</h:panelGrid>
							<h:panelGrid border="0" columns="8"
								rendered='#{objektSearch.selectTipObjekta.value == "2"}'>
								<s:label value="#{messages['label.osobina.115']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.klima}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.119']}" />
								<h:selectBooleanCheckbox
									value="#{searchParameters.parkiraliste}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.132']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.ljubimci}"></h:selectBooleanCheckbox>
							</h:panelGrid>
							<h:panelGrid border="0" cellpadding="0" cellspacing="0" 
								rendered='#{objektSearch.selectTipObjekta.value == "3"}'>
								<h:panelGrid columns="3">
									<s:decorate template="/templates/edit.xhtml">
										<ui:define name="label">
											<s:label value="#{messages['label.kreveti']}" />
										</ui:define>
										<rich:inputNumberSpinner maxValue="15" minValue="1"
											value="#{searchParameters.kreveti}"></rich:inputNumberSpinner>
									</s:decorate>
									<s:decorate template="/templates/edit.xhtml">
										<ui:define name="label">
											<s:label value="#{messages['label.pom_kreveti']}" />
										</ui:define>
										<rich:inputNumberSpinner maxValue="15" minValue="1"
											value="#{searchParameters.pomKreveti}"></rich:inputNumberSpinner>
									</s:decorate>
									<s:decorate template="/templates/edit.xhtml">
										<ui:define name="label">
											<s:label value="#{messages['label.rooms.number']}" />
										</ui:define>
										<rich:inputNumberSpinner maxValue="15" minValue="1"
											value="#{searchParameters.sobe}"></rich:inputNumberSpinner>
									</s:decorate>
								</h:panelGrid>
								<h:panelGrid border="0" columns="8" cellpadding="0"
									cellspacing="0">
									<s:label value="#{messages['label.osobina.132']}" />
									<h:selectBooleanCheckbox value="#{searchParameters.ljubimci}"></h:selectBooleanCheckbox>
									<s:label value="#{messages['label.internet']}" />
									<h:selectBooleanCheckbox value="#{searchParameters.internet}"></h:selectBooleanCheckbox>
									<s:label value="#{messages['label.osobina.115']}" />
									<h:selectBooleanCheckbox value="#{searchParameters.klima}"></h:selectBooleanCheckbox>
									<s:label value="#{messages['label.osobina.19']}" />
									<h:selectBooleanCheckbox value="#{searchParameters.hladnjak}"></h:selectBooleanCheckbox>
									<s:label value="#{messages['label.osobina.119']}" />
									<h:selectBooleanCheckbox
										value="#{searchParameters.parkiraliste}"></h:selectBooleanCheckbox>
									<s:label value="#{messages['label.osobina.160']}" />
									<h:selectBooleanCheckbox value="#{searchParameters.mikrovalna}"></h:selectBooleanCheckbox>
									<s:label value="#{messages['label.osobina.162']}" />
									<h:selectBooleanCheckbox value="#{searchParameters.priborJelo}"></h:selectBooleanCheckbox>
									<s:label value="#{messages['label.osobina.163']}" />
									<h:selectBooleanCheckbox
										value="#{searchParameters.perilicaSudja}"></h:selectBooleanCheckbox>
								</h:panelGrid>
							</h:panelGrid>
							<h:panelGrid border="0" columns="8" cellpadding="0"
								cellspacing="0"
								rendered='#{objektSearch.selectTipObjekta.value == "4"}'>
								<s:label value="#{messages['label.osobina.53']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.sef}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.135']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.posluga}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.132']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.ljubimci}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.94']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.internet}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.115']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.klima}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.134']}" />
								<h:selectBooleanCheckbox
									value="#{searchParameters.prilInvalidima}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.143']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.igrDjeca}"></h:selectBooleanCheckbox>
							</h:panelGrid>
							<h:panelGrid border="0" columns="8" cellpadding="0"
								cellspacing="0"
								rendered='#{objektSearch.selectTipObjekta.value == "5"}'>
								<s:label value="#{messages['label.osobina.119']}" />
								<h:selectBooleanCheckbox
									value="#{searchParameters.parkiraliste}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.115']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.klima}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.132']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.ljubimci}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.94']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.internet}"></h:selectBooleanCheckbox>
							</h:panelGrid>
							<h:panelGrid border="0" columns="8" cellpadding="0"
								cellspacing="0"
								rendered='#{objektSearch.selectTipObjekta.value == "6"}'>
								<s:label value="#{messages['label.osobina.119']}" />
								<h:selectBooleanCheckbox
									value="#{searchParameters.parkiraliste}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.115']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.klima}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.132']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.ljubimci}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.94']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.internet}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.163']}" />
								<h:selectBooleanCheckbox
									value="#{searchParameters.perilicaSudja}"></h:selectBooleanCheckbox>
							</h:panelGrid>
							<h:panelGrid border="0" columns="8" cellpadding="0"
								cellspacing="0"
								rendered='#{objektSearch.selectTipObjekta.value == "7"}'>
								<s:label value="#{messages['label.osobina.20']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.jahanje}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.34']}" />
								<h:selectBooleanCheckbox
									value="#{searchParameters.prilInvalidima}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.43']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.igrDjeca}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.92']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.telefon}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.132']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.ljubimci}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.162']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.priborJelo}"></h:selectBooleanCheckbox>
							</h:panelGrid>
							<h:panelGrid border="0" columns="8" cellpadding="0"
								cellspacing="0"
								rendered='#{objektSearch.selectTipObjekta.value == "8"}'>
								<s:label value="#{messages['label.osobina.34']}" />
								<h:selectBooleanCheckbox
									value="#{searchParameters.prilInvalidima}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.132']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.ljubimci}"></h:selectBooleanCheckbox>
							</h:panelGrid>
							<h:panelGrid border="0" columns="8" cellpadding="0"
								cellspacing="0"
								rendered='#{objektSearch.selectTipObjekta.value == "9"}'>
								<s:label value="#{messages['label.osobina.132']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.ljubimci}"></h:selectBooleanCheckbox>
								<s:label value="#{messages['label.osobina.162']}" />
								<h:selectBooleanCheckbox value="#{searchParameters.priborJelo}"></h:selectBooleanCheckbox>
							</h:panelGrid>
						</a:outputPanel>
						<br />
						<a:commandButton styleClass="submit"
							value="#{messages['label.search']}" reRender="accSearch"
							action="results">
						</a:commandButton>

						<span class="note"><strong><h:outputText
							value="#{messages['message.note.1']}" /> </strong><h:outputText
							value="#{messages['message.note.2']}" /> <em>*</em> <h:outputText
							value="#{messages['message.note.3']}" /></span>

						<h:messages styleClass="error" globalOnly="true"/>
					</s:div>
				</a:region>
			</h:form>
		</rich:panel>
		<s:cache key="search_specialOffer_#{currentLang}" region="pageFragments">
			<ui:include src="/home_specialOffer.xhtml" />
			<ui:include src="/home_smjestajPopMjesta.xhtml" />
		</s:cache>
	</ui:define>
	<ui:define name="column2">
		<s:cache key="objektSpotlight_#{param.idTipaObjekta}_#{currentLang}"
			region="pageFragments">
			<ctg:objektSpotlight imgWidth="175" imgHeight="130" />
			<rich:spacer height="10" />
		</s:cache>
	</ui:define>
	<ui:define name="column3">
		<ctg:googleAds width="120" height="600" slot="9364832571" />
	</ui:define>
</ui:composition>